import re


class Solution:
    def isPalindrome(self, s: str) -> bool:
        s = s.replace(' ', '')
        s = s.lower()
        if len(s) < 2:
            return True
        temp = ''
        for j in range(len(s)):
            if s[j].isalnum():
                temp += s[j]
        s = temp
        flag = True
        for i in range(int(len(s)/2)):
            if s[i] != s[len(s)-i-1]:
                flag = False
        return flag


if __name__ == '__main__':
    x = Solution()
    print(x.isPalindrome('ASDdsa'))